//
//  HNSH_GoodsDetailHeader.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/25.
//

#import "HNSH_GoodsDetailHeader.h"

@interface HNSH_GoodsDetailHeader ()

/* lineView */
@property (nonatomic, strong) UIView *lineView;
/* iconImgV */
@property (nonatomic, strong) UIImageView *iconImgV;
/* titleLabel */
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation HNSH_GoodsDetailHeader

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor appWhiteLabelColor];
        [self configUI];
    }
    return self;
}

- (void)configUI {
//    [self.contentView addSubview:self.lineView];
    [self.contentView addSubview:self.iconImgV];
//    [self.contentView addSubview:self.titleLabel];
    
    [self.iconImgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.centerY.mas_equalTo(0);
        make.width.mas_equalTo(92);
        make.height.mas_equalTo(22);
    }];
    
//    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(16);
//        make.top.mas_equalTo(27);
//        make.height.mas_equalTo(22);
//    }];
}

#pragma mark lazy
- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 6)];
        _lineView.backgroundColor = [UIColor colorWithHexString:@"#EAEAEA"];
    }
    return _lineView;
}

- (UIImageView *)iconImgV {
    if (!_iconImgV) {
        _iconImgV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shop_detail_header_icon"]];
    }
    return _iconImgV;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.text = @"商品详情";
        _titleLabel.textColor = [UIColor appBlackLabelColor];
        _titleLabel.font = [UIFont boldSystemFontOfSize:16];
    }
    return _titleLabel;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
